﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using BartonExtension;
using Cache;
using ProtoBuf;

namespace UnitTest
{
    [ProtoContract]
    class Test
    {
        [ProtoMember(1)]
        public string test1 { get; set; }
        [ProtoMember(2)]
        public string test2 { get; set; }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Test test = new Test()
            {
                test1 = "ewtwwfwe",
                test2 = "ewfwefwefwfw"
            };
            CacheManager.instance.doCacheObject<Test>(test, "test");
            Console.WriteLine("Cached object success");

            //Load cache
            Test tfromcache = CacheManager.instance.objectFromCache<Test>("test");
            Console.WriteLine("Cached data {0},{1}".FormatWith(tfromcache.test1, tfromcache.test2));
            Console.ReadKey();
        }
    }
}
